﻿/**
 * Reboulder - Partial Boulder Dash clone
 * Jesús Sagra, 2014
 * 
 * Map class: map for a level
 * 
 * Version    Date     Changes
 * -----------------------------------------------------
 *  0.01   07-dic-2014  Attributes, constructor, draw map, check collisions.
 *  0.02   08-dic-2014  Map readers.
 *  0.03   26-feb-2015  Map loader from files
 */

using System;
using System.IO;
using System.Collections.Generic;

class Map
{
    protected int mapWidth;
    protected int mapHeight;
    
    protected int backgroundTileSize;
    protected string[] level;
   


    public Map()
    {
        backgroundTileSize = 32;
        LoadMap("level1");        
    }

    public string[] GetLevel()
    {
        return level;
    }

    public int GetMapHeight()
    {
        return mapHeight;
    }

    public int GetMapWidth()
    {
        return mapWidth;
    }

    public void LoadMap(string file)
    {
        StreamReader mapReader = File.OpenText(file + ".txt");
        mapWidth = Convert.ToInt32(mapReader.ReadLine());
        mapHeight = Convert.ToInt32(mapReader.ReadLine());
        level = new string[mapHeight];
        for (int i = 0; i < mapHeight; i++)
        {
            level[i] = mapReader.ReadLine();
        }
    }



}